//
//  WHTreeFooterView.m
//  WHEasyBizLink
//
//  Created by shengmeng chen on 2024/12/10.
//

#import "WHTreeFooterView.h"
#import "SDAutoLayout.h"

@implementation WHTreeFooterView

-(void)createUIControls
{
    [super createUIControls];
    self.backgroundColor =RGBColor(250, 250, 250);
    UIButton*submitBtn = [[UIButton alloc] init];
    [submitBtn setTitle:@"确  定" forState:UIControlStateNormal];
    [submitBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    submitBtn.backgroundColor =RGBColor(54,141,246);
    submitBtn.titleLabel.font =[UIFont systemFontOfSize:20];
    
    submitBtn.layer.cornerRadius  = 8;
    submitBtn.layer.masksToBounds = YES;
    _submitBtn = submitBtn;
   [submitBtn addTarget:self action:@selector(submitBtnClick:)
      forControlEvents:UIControlEventTouchUpInside];

    [self addSubview:submitBtn];
    
    [self setUpUIControlsLayouts];
}

-(void)setUpUIControlsLayouts
{
    _submitBtn.sd_layout.
    topSpaceToView(self,kMarginH*2)
    .leftSpaceToView(self,kMarginW*8)
    .rightSpaceToView(self,kMarginW*8)
    .heightIs(kMarginH*3);
    
}

-(void)submitBtnClick:(UIButton*)btn
{
    if(self.clickBtnBlock)
    {
        self.clickBtnBlock(btn);
    }
}


@end
